package com.dj.mingkong.portal.biz.repository.database.music;

import com.dj.mingkong.common.infrastructure.base.dto.query.QueryVo;
import com.dj.mingkong.common.infrastructure.base.repository.BaseDatabaseRepository;
import com.dj.mingkong.common.infrastructure.eo.database.music.MusicianVisitEo;
import com.dj.mingkong.portal.biz.repository.database.music.mapper.MusicianVisitMapper;
import org.springframework.stereotype.Repository;

import java.util.Optional;

/**
 * 音乐人访客repository
 *
 * @author zenglonghui
 * @date: 2022/8/21 13:45
 */
@Repository
public class MusicianVisitRepository extends BaseDatabaseRepository<MusicianVisitMapper, MusicianVisitEo, QueryVo> {
    public Optional<MusicianVisitEo> oneOptByUserIdAndMusicianId(Long userId, Long musicianId) {
        return lambdaQuery()
                .eq(MusicianVisitEo::getUserId, userId)
                .eq(MusicianVisitEo::getMusicianId, musicianId)
                .oneOpt();
    }
}
